package pattern.responsibilityChain;

/**
 * @Author: Yangu
 * @Created time: 2020/11/4 16:24
 * @Description :
 */
public class ResponsibilityTest {

    public static void main(String[] args) {
        LeaveRequest request = LeaveRequest.builder().leaveDays(20).name("小明").build();


        AbstractLeaveHandler directLeaderLeaveHandler = new DirectLeaderLeaveHandler("县令");
        AbstractLeaveHandler deptManagerLeaveHandler = new DeptManagerLeaveHandler("知府");
        AbstractLeaveHandler gManagerLeaveHandler = new GManagerLeaveHandler("京兆尹");

        directLeaderLeaveHandler.setNextHandler(deptManagerLeaveHandler);
        deptManagerLeaveHandler.setNextHandler(gManagerLeaveHandler);

        directLeaderLeaveHandler.handlerRequest(request);
    }
}
